/**
* Created by wl
* 基金储备库-编辑管理和运行信息
*/
<template>
    <div>
        <div class="ca-title">
            <div class="el-right">
                <el-button type="primary" size="small" @click="save">保存</el-button>
                <el-button @click="close" size="small">取消</el-button>
            </div>
        </div>
        <el-form ref="itemInfoRule" :model="fundFunctionEntity" class="ca-m-t-15">
            <div class='el-table'>
                <h2>基金治理架构</h2>
                <p>
                    <el-input type="textarea" v-model="fundFunctionEntity.government" :maxlength="4000"></el-input>
                </p>
            </div>
            <div class='el-table'>
                <h2>基金投资策略</h2>
                <p>
                    <el-input type="textarea" v-model="fundFunctionEntity.investment" :maxlength="4000"></el-input>
                </p>
            </div>
            <div class='el-table'>
                <h2>项目遴选机制</h2>
                <p>
                    <el-input type="textarea" v-model="fundFunctionEntity.choose" :maxlength="4000"></el-input>
                </p>
            </div>
            <div class='el-table'>
                <h2>投资决策机制</h2>
                <p>
                    <el-input type="textarea" v-model="fundFunctionEntity.policyDecision" :maxlength="4000"></el-input>
                </p>
            </div>
            <div class='el-table'>
                <h2>增值服务</h2>
                <p>
                    <el-input type="textarea" v-model="fundFunctionEntity.increment" :maxlength="4000"></el-input>
                </p>
            </div>
            <div class='el-table'>
                <h2>风险防范</h2>
                <p>
                    <el-input type="textarea" v-model="fundFunctionEntity.risk" :maxlength="4000"></el-input>
                </p>
            </div>
            <div class='el-table'>
                <h2>投资退出</h2>
                <p>
                    <el-input type="textarea" v-model="fundFunctionEntity.exitInvestment" :maxlength="4000"></el-input>
                </p>
            </div>
        </el-form>
    </div>
</template>
<script type="text/ecmascript-6">
    import {api} from '../../api';
    import {STATUS_HTTP_SUCCESS, apiHttp} from '__service/csHttp';
    export default {
        data() {
            return {
                fundFunctionEntity: {
                    choose: '',// 项目遴选机制
                    exitInvestment: '',// 投资退出
                    fundId: '',// 基金id
                    government: '',// 基金治理架构
                    id: '',// 主id
                    increment: '',// 增值服务
                    investment: '',// 基金投资策略
                    policyDecision: '',// 投资决策机制
                    risk: '',// 风险防范
                }
            }
        },
        watch: {
        },
        props: {
        },
        mounted() {
            this.fundFunctionEntity.fundId = this.$route.params.itemId === '-1' ? '' : this.$route.params.itemId;
            if (this.$route.params.itemId) {
                this.getInfo()
            }
        },
        methods: {
            close() {
                this.$emit('close')
            },
            getInfo() {
                apiHttp(api.CHECK_FUNCTIONINFO, {id: this.$route.params.itemId}).then(ret => {
                    if (ret.resCode === STATUS_HTTP_SUCCESS) {
                        if (ret.data) {
                            this.fundFunctionEntity = ret.data;
                        }
                    }
                })
            },
            save() {
                apiHttp(api.SAVE_FUNCTIONINFO, this.fundFunctionEntity).then(ret => {
                    if (ret.resCode === STATUS_HTTP_SUCCESS) {
                        this.$message({
                            message: '数据保存成功！',
                            type: 'success',
                            center: true
                        });
                        this.$emit('update')
                    }
                })
            },
        },
        components: {
        },
    }
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.el-right {
    float: right;
}
.el-table {
    display: flex;
    border-top: #dbe3ea 1px solid;
    border-right: #dbe3ea 1px solid;
    border-left: #dbe3ea 1px solid;
}
.el-table h2 {
    width: 170px;
    background: #eef1f6;
    text-align: center;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 10px;
    border-right: #dbe3ea 1px solid;
    font-size: 14px;
    font-weight: normal;
}
.el-table p {
    flex: 1;
    padding: 5px;
    line-height: 30px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-left: 10px;
}
.el-table:last-child {
    border-bottom: 1px solid #ccc;
} 
</style>